package com.surge;

import java.util.HashMap;
import java.util.Map;

public class InstanceCarFactory {
	private Map<String, Car> cars = null;
	
	public InstanceCarFactory() {
		cars = new HashMap<String, Car>();
		cars.put("audi", new Car("audi","beijing",300000));
		cars.put("baoma", new Car("baoma","beijing",400000));
		
	}
	
	// 实例工厂方法 返回Car
	public Car getCar(String name) {
		return cars.get(name);
	}
}
